package cn.sunjinxin.trade.domain.service;

import cn.sunjinxin.savior.ext.container.ExtExecutor;
import cn.sunjinxin.savior.ext.container.ExtRo;
import cn.sunjinxin.trade.domain.ability.PayAbility;
import cn.sunjinxin.trade.domain.model.FundOrder;
import cn.sunjinxin.trade.domain.model.Order;
import cn.sunjinxin.trade.domain.model.ProductSku;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author issavior
 */
@Service
@Slf4j
public class PayDomainService {

    private static final ExecutorService executorService = Executors.newFixedThreadPool(10);

    public Boolean check() {
        return new ExtExecutor<>(PayAbility.class).execFirst(ExtRo.builder()
                .bizCode("")
                .scenario("inventory")
                .industry("trade")
                .business("preorder").build(), e -> e.replenishment(null));
    }

    public String pay(List<ProductSku> productSkus) {
        return "";

    }

    public FundOrder createFundOrder(Order order, String userId) {
        FundOrder fundOrder = FundOrder.init();
        return fundOrder;
    }

}
